<?php
  echo form_open('forum/post');
  echo '<table class="reply">';
  echo '<tr>';
  echo '<td>';
  echo form_hidden('parent_id', $parent_id);
  echo form_hidden('category_id', $category_id);
  echo form_hidden('flash_code', $flash_code);
  echo lang('Title', 'title');
  echo '<br />';
  echo form_input(array('name' => 'title', 'value' => set_value('title'), 'id' => 'title', 'class' => 'text'));
  echo '</td>';
  echo '<td></td>';
  echo '</tr>';
  echo '<tr>';
  echo '<td>';
  echo '<div id="bb_toolbar"></div>';
  echo form_textarea(array('name' => 'body', 'id'=>'body', 'rows' => 3));
  echo '<div class="ar buttons">';
  echo form_submit('post', lang('Reply'));
  echo '</div>';
  echo '</td>';
  echo '<td id="emoticons">';
  $lv = '';
  foreach($smileys as $k => $v){
    if ($lv != $v){
      echo '<a href="javascript:return void(0);" title="'.$k.' "><img height="16" width="16" src="/img/smileys/'.$v.'" alt="'.$k.'" /></a>';
      $lv = $v;
    }
  }
  echo '</td>';
  echo '</tr>';
  echo '<table>';
  echo form_close();
  //echo smiley_js('body');
  echo '<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>';
  echo '<script type="text/javascript" src="/js/markitup/jquery.markitup.js"></script>';
  echo '<script type="text/javascript" src="/js/markitup/bbcode/set.js"></script>';
?>
<script language="javascript">
$(document).ready(function()	{
    $('#body').markItUp(mySettings);

    $('#emoticons a').click(function() {
        emoticon = $(this).attr("title");
        $.markItUp( { replaceWith:emoticon } );
    });
});
</script>
<?php
  echo '<link rel="stylesheet" type="text/css" href="/js/markitup/skins/simple/style.css" />';
  echo '<link rel="stylesheet" type="text/css" href="/js/markitup/sets/default/style.css" />';
  echo '<link rel="stylesheet" type="text/css" href="/js/markitup/bbcode/style.css" />';

//  echo '<script type="text/javascript" src="/js/bbeditor/ed.js"></script>';
//  echo '<script>edToolbar("body", "bb_toolbar"); </script>';
?>
